package com.naiterui.ehp.bp.domain;

import static javax.persistence.GenerationType.IDENTITY;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Version;

import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

/**
 * <p>Description: 医生标签-活动关系表</p>
 * @author xudong

 * @date 2017年11月24日
 * @since 1.0.0
 */
@Entity
@Table(name = "cms_banner_label")
@DynamicInsert(true)// 使用数据库的默认值
@DynamicUpdate(true)
public class BannerLabel implements Serializable {
    /**
     * 字段或域定义：<code>serialVersionUID</code>
     */
    private static final long serialVersionUID = -3942250523157517561L;

    private Long id;

    /** 医生标签id */
    private Long labelId;

    /** 活动id */
    private Long bannerId;

    /** 创建时间 */
    private Date createdAt;

    /** 修改时间 */
    private Date changedAt;

    /** 创建人 */
    private String createdBy;

    /** 修改人 */
    private String changedBy;

    /** 版本 */
    private Integer version;

    public BannerLabel() {
        super();
    }

    public BannerLabel(Long labelId, Long bannerId) {
        this.labelId = labelId;
        this.bannerId = bannerId;
        this.createdAt = new Date();
        this.createdBy = "system";
    }

    @Id
    @GeneratedValue(strategy = IDENTITY)
    @Column(name = "id", unique = true, nullable = false)
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    @Column(name = "label_id")
    public Long getLabelId() {
        return labelId;
    }

    public void setLabelId(Long labelId) {
        this.labelId = labelId;
    }

    @Column(name = "banner_id")
    public Long getBannerId() {
        return bannerId;
    }

    public void setBannerId(Long bannerId) {
        this.bannerId = bannerId;
    }

    @Column(name = "created_at")
    public Date getCreatedAt() {
        return createdAt;
    }


    public void setCreatedAt(Date createdAt) {
        this.createdAt = createdAt;
    }

    @Column(name = "changed_at")
    public Date getChangedAt() {
        return changedAt;
    }

    public void setChangedAt(Date changedAt) {
        this.changedAt = changedAt;
    }

    @Column(name = "created_by")
    public String getCreatedBy() {
        return createdBy;
    }

    public void setCreatedBy(String createdBy) {
        this.createdBy = createdBy;
    }

    @Column(name = "changed_by")
    public String getChangedBy() {
        return changedBy;
    }

    public void setChangedBy(String changedBy) {
        this.changedBy = changedBy;
    }

    @Version
    public Integer getVersion() {
        return version;
    }

    public void setVersion(Integer version) {
        this.version = version;
    }

}
